144c7b3ec5c5517b0af4fa311b42001a8e1b75bd
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * http://www.gnu.org/copyleft/gpl.html
22 * implements Special:Wantedpages
23 * @ingroup SpecialPage
25 class WantedPagesPage
extends WantedQueryPage
{
28 function WantedPagesPage( $inc = false, $nlinks = true ) {
29 $this->setListoutput( $inc );
30 $this->nlinks
= $nlinks;
38 global $wgWantedPagesThreshold;
39 $count = $wgWantedPagesThreshold - 1;
40 $dbr = wfGetDB( DB_SLAVE
);
41 $pagelinks = $dbr->tableName( 'pagelinks' );
42 $page = $dbr->tableName( 'page' );
43 $sql = "SELECT 'Wantedpages' AS type,
44 pl_namespace AS namespace,
48 LEFT JOIN $page AS pg1
49 ON pl_namespace = pg1.page_namespace AND pl_title = pg1.page_title
50 LEFT JOIN $page AS pg2
51 ON pl_from = pg2.page_id
52 WHERE pg1.page_namespace IS NULL
53 AND pl_namespace NOT IN ( " . NS_USER
. ", ". NS_USER_TALK
. ")
54 AND pg2.page_namespace != " . NS_MEDIAWIKI
. "
55 GROUP BY pl_namespace, pl_title
56 HAVING COUNT(*) > $count";
58 wfRunHooks( 'WantedPages::getSQL', array( &$this, &$sql ) );
66 function wfSpecialWantedpages( $par = null, $specialPage ) {
67 $inc = $specialPage->including();
70 @list
( $limit, $nlinks ) = explode( '/', $par, 2 );
72 $nlinks = $nlinks === 'nlinks';
75 list( $limit, $offset ) = wfCheckLimits();
79 $wpp = new WantedPagesPage( $inc, $nlinks );
81 $wpp->doQuery( $offset, $limit, !$inc );